//
// Created by liushuai on 18-8-26.
//
#include "Node.hpp"
#include <vector>
#ifndef EX7_Graph_Travel_HPP
#define EX7_Graph_Travel_HPP


class Graph_Travel {
private:
    //图中可以存放的顶点数
    int Capacity;
    // 已经添加的顶点数
    int NodeCount;
    // 存放顶点的数组
    Node *NodeArray;
    // 邻接矩阵
    int *adj_Matrix;
    //从矩阵中获取权值
    bool getValueFromMatrix(int row,int col,int &val);
    //广度优先遍历实现函数
    void breadthFirstTraverseImp(std::vector<int> preVec);
public:
    Graph_Travel(int capacity);
    ~Graph_Travel();
    //向图中添加节点
    bool addNode(Node *pNode);
    //reset顶点
    void resetNode();
    bool setValueToMatrixForDirectedGraph(int row,int col,int val=1);
    bool setValueToMatrixUndirectedGraph(int row,int col,int val=1);
    //打印邻接矩阵
    void printMatrix();
    void DFS(int nodeIndex);
    void BFS(int nodeIndex);

};
#endif //EX7_Graph_Travel_HPP
